package com.crm.pojo;

import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
public class Scheme {
    private Long scId;
    private String scTheme;
    private Long chanceId;
    private Long clientId;
    private Date submintTime;
    private Long chragePeopleId;
    private String scCheck;
    private String schemeIsDel;
    private String clientInfoFeedback;
    private String schemeContent;

    @Id
    @SequenceGenerator(initialValue = 1, allocationSize = 1, name = "SCHEME_SCID_GENERATOR", sequenceName = "SEQ1")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SCHEME_SCID_GENERATOR")
    @Column(name = "SC_ID")
    public Long getScId() {
        return scId;
    }

    public void setScId(Long scId) {
        this.scId = scId;
    }

    @Basic
    @Column(name = "SC_THEME")
    public String getScTheme() {
        return scTheme;
    }

    public void setScTheme(String scTheme) {
        this.scTheme = scTheme;
    }

    @Basic
    @Column(name = "CHANCE_ID")
    public Long getChanceId() {
        return chanceId;
    }

    public void setChanceId(Long chanceId) {
        this.chanceId = chanceId;
    }

    @Basic
    @Column(name = "CLIENT_ID")
    public Long getClientId() {
        return clientId;
    }

    public void setClientId(Long clientId) {
        this.clientId = clientId;
    }

    @Basic
    @JSONField(format = "yyyy-MM-dd")
    @Temporal(TemporalType.DATE)
    @Column(name = "SUBMINT_TIME")
    public Date getSubmintTime() {
        return submintTime;
    }

    public void setSubmintTime(Date submintTime) {
        this.submintTime = submintTime;
    }

    @Basic
    @Column(name = "CHRAGE_PEOPLE_ID")
    public Long getChragePeopleId() {
        return chragePeopleId;
    }

    public void setChragePeopleId(Long chragePeopleId) {
        this.chragePeopleId = chragePeopleId;
    }

    @Basic
    @Column(name = "SC_CHECK")
    public String getScCheck() {
        return scCheck;
    }

    public void setScCheck(String scCheck) {
        this.scCheck = scCheck;
    }

    @Basic
    @Column(name = "SCHEME_IS_DEL")
    public String getSchemeIsDel() {
        return schemeIsDel;
    }

    public void setSchemeIsDel(String schemeIsDel) {
        this.schemeIsDel = schemeIsDel;
    }

    @Basic
    @Column(name = "CLIENT_INFO_FEEDBACK")
    public String getClientInfoFeedback() {
        return clientInfoFeedback;
    }

    public void setClientInfoFeedback(String clientInfoFeedback) {
        this.clientInfoFeedback = clientInfoFeedback;
    }

    @Basic
    @Column(name = "SCHEME_CONTENT")
    public String getSchemeContent() {
        return schemeContent;
    }

    public void setSchemeContent(String schemeContent) {
        this.schemeContent = schemeContent;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Scheme scheme = (Scheme) o;
        return Objects.equals(scId, scheme.scId) &&
                Objects.equals(scTheme, scheme.scTheme) &&
                Objects.equals(chanceId, scheme.chanceId) &&
                Objects.equals(clientId, scheme.clientId) &&
                Objects.equals(submintTime, scheme.submintTime) &&
                Objects.equals(chragePeopleId, scheme.chragePeopleId) &&
                Objects.equals(scCheck, scheme.scCheck) &&
                Objects.equals(schemeIsDel, scheme.schemeIsDel) &&
                Objects.equals(clientInfoFeedback, scheme.clientInfoFeedback) &&
                Objects.equals(schemeContent, scheme.schemeContent);
    }

    @Override
    public int hashCode() {
        return Objects.hash(scId, scTheme, chanceId, clientId, submintTime, chragePeopleId, scCheck, schemeIsDel, clientInfoFeedback, schemeContent);
    }
}
